<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>

<c:if test="${notfound != null}">
	<div class="errorblock">
		<spring:message code="notfound.product" />
	</div>
</c:if>

<c:if test="${notfound == null}">
	<a style="float: left"
		href="<c:url value="/product?id=${product.id}"/>"><img
		class="product-image" src="<c:url value="${product.imagePath}"/>"
		alt="" /></a>
	<div class="product-detail">
		<h3>${product.name}</h3>
		<div class="product-desc">
			<h4>
				<spring:message code="id" />
				: ${product.id}
			</h4>
			<h5>
				<spring:message code="viewed" />
				: ${product.views}
			</h5>
			<h5>
				<spring:message code="numsold" />
				: ${product.amountSold}
			</h5>
			<br />
			<h4>${product.type.name}</h4>
			<h4>
				<spring:message code="madein" />
				: ${product.madeIn}
			</h4>
			<h4>
				<spring:message code="producer" />
				: ${product.producer.name}
			</h4>
			<br />
			<p>${product.description}</p>
			<br /> <strong class="price"> <fmt:formatNumber
					type="number" value="${product.price}" groupingUsed="true" /> VNĐ
			</strong>
			<form action="product" method="post">
				<input id="productId" type="hidden" name="productId"
					value="${product.id}" /> <input id="quantity-product"
					name="quantity" type="number" min="1" max="99999" value="1" /> <input
					id="btnAddToCart" type="submit"
					value="<spring:message code="add_to_cart" />" />
				<div id="plusone-div">
					<img id="gplus" src="images/fb-like-button.png"
						onLoad="return renderGPlus();">
				</div>
				<div id="fblikediv">
					<img src="images/fb-like-button.png" id="fblikeimg"
						onLoad="return renderFbLike();">
				</div>
			</form>

			<div id="fb-root"></div>
			<div class="fb-comments" data-href="${fullUrl}" data-width="470"
				data-num-posts="2"></div>
		</div>
</c:if>